﻿namespace KinonekoSoftware.CodariaDB.Documents.DataParts.Modules.RVE
{
    public sealed class Block_RVE : ModuleBlock
    {
        public static Block_RVE CreateCharacter() => new Block_RVE
        {
            Id = ID.Get(),
            Part_Primary = new List<IMainVisualRowElement>
            {
                new RVE_Dashboard { Id = ID.Get(), Title = "生命值", Maximum  = 99999, Value = 3086, Color = "#dc143c" },
                new RVE_Dashboard { Id = ID.Get(), Title = "物理防御", Maximum = 5999, Value  = 1099, Color = "#b25838" },
                new RVE_Dashboard { Id = ID.Get(), Title = "魔法防御", Maximum = 3999, Value  = 884, Color  = "#c191ff" },
                new RVE_Dashboard { Id = ID.Get(), Title = "攻击力", Maximum  = 99999, Value = 4086, Color = "#ff7f50" },
                new RVE_Dashboard { Id = ID.Get(), Title = "攻击速度", Maximum = 1000, Value  = 367, Color  = "#ffb650" },
                new RVE_Dashboard { Id = ID.Get(), Title = "移动速度", Maximum = 10000, Value = 2860, Color = "#ffb650" },
                new RVE_Dashboard { Id = ID.Get(), Title = "冷却缩减", Maximum = 100, Value   = 32, Color   = "#ffb650" },
                new RVE_Zodiac(),
                new RVE_ChineseZodiac(),
            },
            Part_Secondary = new List<RVE_Element>
            {
                new RVE_ElementRibbon(),
                new RVE_RarityRibbon(),
            },
            Part_Hybrid = new List<IHybridModuleBlock>
            {
                new Element_Numeric { Id = ID.Get(), Title = "年龄", Maximum = 99999, Minimum = 0, Value = 19 },
                new Element_Numeric { Id = ID.Get(), Title = "体重", Maximum = 99999, Minimum = 0, Value = 79 },
                new Element_Text { Id    = ID.Get(), Title = "国家", Value   = "巴瑞斯尔德" },
                new Element_Text { Id    = ID.Get(), Title = "种族", Value   = "龙族" },
                new Element_Option
                {
                    Id      = ID.Get(),
                    Title   = "选项",
                    ValueID = "1",
                    Items = new List<Primitive_Option>
                    {
                        new Primitive_Option { Id = "1", Name = "选项1", Value = "1" },
                        new Primitive_Option { Id = "2", Name = "选项2", Value = "1" },
                        new Primitive_Option { Id = "3", Name = "选项3", Value = "1" },
                        new Primitive_Option { Id = "4", Name = "选项4", Value = "1" },
                    },
                },
                new Element_Numeric { Id = ID.Get(), Title = "数字1", Value = 33, Maximum = 99999, Minimum = 0 },
                new Element_Numeric { Id = ID.Get(), Title = "数字2", Value = 43, Maximum = 99999, Minimum = 0 },
            },
        };
        
        public static Block_RVE CreateInstance() => new Block_RVE
        {
            Id           = ID.Get(),
            Part_Primary = new List<IMainVisualRowElement>(),
            Part_Secondary = new List<RVE_Element>
            {
                new RVE_ElementRibbon(),
                new RVE_RarityRibbon(),
            },
            Part_Hybrid = new List<IHybridModuleBlock>
            {
                new Element_Numeric { Id = ID.Get(), Title = "年龄", Maximum = 99999, Minimum = 0, Value = 19 },
                new Element_Numeric { Id = ID.Get(), Title = "体重", Maximum = 99999, Minimum = 0, Value = 79 },
                new Element_Text { Id    = ID.Get(), Title = "国家", Value   = "巴瑞斯尔德" },
                new Element_Text { Id    = ID.Get(), Title = "种族", Value   = "龙族" },
                new Element_Option
                {
                    Id      = ID.Get(),
                    Title   = "选项",
                    ValueID = "1",
                    Items = new List<Primitive_Option>
                    {
                        new Primitive_Option { Id = "1", Name = "选项1", Value = "1" },
                        new Primitive_Option { Id = "2", Name = "选项2", Value = "1" },
                        new Primitive_Option { Id = "3", Name = "选项3", Value = "1" },
                        new Primitive_Option { Id = "4", Name = "选项4", Value = "1" },
                    },
                },
                new Element_Numeric { Id = ID.Get(), Title = "数字1", Value = 33, Maximum = 99999, Minimum = 0 },
                new Element_Numeric { Id = ID.Get(), Title = "数字2", Value = 43, Maximum = 99999, Minimum = 0 },
            },
        };
        
        public static Block_RVE Create() => new Block_RVE
        {
            Id           = ID.Get(),
            Part_Primary = new List<IMainVisualRowElement>(),
            Part_Secondary = new List<RVE_Element>(),
            Part_Hybrid = new List<IHybridModuleBlock>(),
        };

        public Block_RVE()
        {
            Title = LanguageManager.GetText("Module.RVE");
        }

        public required List<IMainVisualRowElement> Part_Primary   { get; init; }
        public required List<RVE_Element>           Part_Secondary { get; init; }
        public required List<IHybridModuleBlock>    Part_Hybrid    { get; init; }


        public override ModuleBlock Clone()
        {
            return new Block_RVE
            {
                Id             = Id,
                Title          = Title,
                Description    = Description,
                Index          = Index,
                Part_Primary   = Part_Primary.Select(x => x.Clone()).ToList(),
                Part_Hybrid    = Part_Hybrid.Select(x => x.Clone()).ToList(),
                Part_Secondary = Part_Secondary.Select(x => x.Clone()).ToList(),
            };
        }
    }
}